/*MyPhotoIndex Free Photo Organizer <www.myphotoindex.com>
  Copyright (C) <2006-2009>  <Asaf Yarkoni asaf@yarkoni.net>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.*/
using System;
using System.Collections.Generic;
using System.Text;
using MyPhotoIndex.Interfaces;
using MyPhotoIndex.Controls.TagTree;
using MyPhotoIndex.DataAccess;
using MyPhotoIndex.ImageBank;
using MyPhotoIndex.Interfaces.Imaging;
using MyPhotoIndex.Interfaces.Tagging;
using MyPhotoIndex.Utilities;
using System.Drawing;

namespace MyPhotoIndex
{
    class TagIconsImageCollection : IImageCollection
    {
        private readonly int m_iconsCount = 30;
        private List<TagIconsImageData> m_images = new List<TagIconsImageData>();

        public TagIconsImageCollection()
        {
            for (int i = 0; i < m_iconsCount; i++)
            {
                m_images.Add(new TagIconsImageData(i, (Image)Properties.Icons.ResourceManager.GetObject("icon_" + i)));
            }
        }

        #region IImageCollection Members

        public IImageData this[int imageId]
        {
            get
            {
                return m_images[imageId];
            }
        }

        public int Count
        {
            get
            {
                return m_iconsCount;
            }
        }

        #endregion

        public void Add(int tagId)
        {
            throw new NotImplementedException(Resources.Resources.MethodIsNotImplemented);            
        }

        public void Remove(int tagId)
        {
            throw new NotImplementedException(Resources.Resources.MethodIsNotImplemented);          
        }

        public void Remove(int imageId, bool deleteFromMedia)
        {
            throw new NotImplementedException(Resources.Resources.MethodIsNotImplemented);
        }

        internal void Clear()
        {
            throw new NotImplementedException(Resources.Resources.MethodIsNotImplemented);
        }

        public IImageData[] ToArray()
        {
            return m_images.ToArray();
        }

        #region IEnumerable<ImageData> Members

        public IEnumerator<IImageData> GetEnumerator()
        {
            for (int i = 0; i < m_iconsCount; i++)
            {
                yield return this[i];
            }
        }

        #endregion

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }

        #endregion

        #region IImageCollection Members

        public event EventHandler<EventArgs> ImageCollectionLoadedEvent;

        #endregion

        #region IDisposable Members

        public void Dispose()
        {

        }

        #endregion
    }
}
